package frontend.model.admin;

import backend.model.admin.Activity;
import frontend.model.base.UIModel;

public class ActivityUIModel implements UIModel<Activity> {

    private String name;
    private boolean isActive;

    private Activity activity;

    public ActivityUIModel() {
        activity= new Activity();
        isActive = true;
    }

    public ActivityUIModel(Activity activity) {
        this.activity= activity;
        populateFieldsFromDBModel();
    }

    @Override
    public void populateFieldsFromDBModel() {
        name = activity.getName();
        isActive = activity.getIsActive();
    }

    @Override
    public void populateDBModelFromFields() {
        activity.setName(name);
        activity.setIsActive(isActive);
    }

    public String getName() {
        return name;
    }

    @Override
    public Activity getDBModel() {
        return activity;
    }
}
